package org.springblade.modules.mes.opcua.constant;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class OpcUaTool {

	private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd" );
	private static final DateTimeFormatter DATE_FORMATTER_SHORT = DateTimeFormatter.ofPattern("yyMMdd" );

	/**
	 * 获取当前时间标记 [y + Hex(MM) + dd]
	 *
	 * @return 当前时间4位码
	 */
	public static String getDateStr() {
		String date = LocalDate.now().format(DATE_FORMATTER);
//		return date.substring(3, 4)
//			.concat(Integer.toHexString(Integer.parseInt(date.substring(4, 6))).toUpperCase()
//				.concat(date.substring(6, 8)));

		return date;
	}
}
